#include <iostream>
#include <vector>

using namespace std;

template <typename T>
void read(vector <T> &data) {
    int length;
    cin >> length;
    data.resize(length);
    for (int i = 0; i < length; ++i) {
        cin >> data[i];
    }
    return;
}

template <typename iterator, typename T>
iterator partition(iterator begin, iterator end, T value) {
    if (end - begin == 0)
        return begin;
    iterator left = begin, right = end - 1;
    while (left != right) {
        while (left != right && *left < value) {
            ++left;
        }
        while (left != right && *right >= value) {
            --right;
        }
        swap(*left, *right);
        if (left == right || left == right - 1)
            break;
        ++left, --right;
    }
    if (*begin >= value)
        return begin;
    while (*left >= value && left != begin)
        --left;
    while (left != end && *left < value)
        ++left;
    return left;
}

template <typename iterator>
void sort(iterator begin, iterator end) {
    if (end - begin <= 1)
        return;
    int length = end - begin;
    int value = *(begin + rand() % length);
    iterator middle = partition(begin, end, value);
    sort(begin, middle);
    while (middle != end && *middle == value)
        ++middle;
    sort(middle, end);
}

template <typename T>
void print(vector <T> &data) {
    for (int i = 0; i < data.size(); ++i) {
        cout << data[i] << ' ';
    }
    cout << endl;
    return;
}

int main() {
    vector <int> data;
    read(data);
    srand(time(NULL));
    sort(data.begin(), data.end());
    print(data);
}
